{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a558fc6063f1498489a417b97884b956",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "NGLWidget()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import nglview as nv\n",
    "\n",
    "# view = nv.show_pdbid(\"2D3U\") # load \"2D3U\" from RCSB PDB and display viewer widget\n",
    "view = nv.show_file(\"2D3U.pdb\")\n",
    "view.representations = [\n",
    "    {\"type\": \"cartoon\", \"params\": {\n",
    "        \"sele\": \"protein\", \"color\": \"residueindex\"\n",
    "    }},\n",
    "    {\"type\": \"ball+stick\", \"params\": {\n",
    "        \"sele\": \"ligand\"\n",
    "    }}\n",
    "]\n",
    "\n",
    "view"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Github does not support nglview rendering therefore, I upload screenshot of results.\n",
    "![](https://i.imgur.com/QPaxFNU.png)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
